package com.ruoyi.common.enums;


public enum RoleKeyEnum {

    BOSS("boss", "等同于超级管理员"),
    MANAGER("manager", "管理员"),
    WRITER("writer", "写手");

    private final String code;

    private final String value;

    RoleKeyEnum(String code, String value) {
        this.code = code;
        this.value = value;
    }

    public String getCode() {
        return code;
    }

    public String getValue() {
        return value;
    }

    public static RoleKeyEnum getRoleKey(String code) {
        for (RoleKeyEnum roleKeyEnum : RoleKeyEnum.values()) {
            if (roleKeyEnum.getCode().equals(code)) {
                return roleKeyEnum;
            }
        }
        return null;
    }
}
